<?php

class My_Form_Element_MinMax extends Zend_Form_Element_Multi {

    /**
     * 'multiple' attribute
     * @var string
     */
    public $multiple = 'multiple';

    /**
     * Use formSelect view helper by default
     * @var string
     */
    public $helper = 'formMinMax';

    /**
     * Multiselect is an array of values by default
     * @var bool
     */
    protected $_isArray = true;
    
    public function getValue() {
        $result = parent::getValue();
        return array(
            'min' => $result[0],
            'max' => $result[1],
        );
    }
    
    public function setValue($value) {
        if(isset($value['min']) && $value['max']) {
            $value = array($value['min'], $value['max']);
        }
        return parent::setValue($value);
    }

}